package com.shen.langchain4j.config;

import dev.langchain4j.community.model.dashscope.WanxImageModel;
import dev.langchain4j.model.chat.ChatModel;
import dev.langchain4j.model.openai.OpenAiChatModel;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * 大模型配置类
 */
@Configuration
public class LLMConfig {
    @Bean
    public ChatModel chatLanguageModel() {
        return OpenAiChatModel.builder()
                //api-key
                .apiKey(System.getenv("aliyunQwen-apiKey"))
                //调用模型名
                .modelName("qwen3-vl-plus")
                //调用阿里云百炼平台大模型的url
                .baseUrl("https://dashscope.aliyuncs.com/compatible-mode/v1")
                .build();
    }

    /**
     * 文本生成图片模型-通义万相
     *
     * @return 通义万相模型
     */
    @Bean
    public WanxImageModel wanxImageModel() {
        return WanxImageModel.builder()
                .apiKey(System.getenv("aliyunQwen-apiKey"))
                .modelName("wan2.5-t2i-preview")
                .build();
    }
}
